Method and system for managing buffer device in storage system

ABSTRACT

A method and system for managing a buffer device in a storage system. The method comprising determining a first priority for a first queue included in the buffer device, the first queue comprising at least one data page associated with a first storage device in the storage system; in at least one round, in response to the first priority not satisfying a first predetermined condition, updating the first priority according to a first updating rule, the first updating rule making the updated first priority much closer to the first predetermined condition than the first priority; and in response to the first priority satisfying the first predetermined condition, flushing data in a data page in the first queue to the first storage device.

RELATED APPLICATIONS

This application claim priority from Chinese Patent Application NumberCN201611193465.9, filed on Dec. 21, 2016 at the State IntellectualProperty Office, China, titled “METHOD AND APPARATUS FOR MANAGING BUFFERDEVICE IN STORAGE SYSTEM” the contents of which is herein incorporatedby reference in its entirety.

FIELD

Various embodiments of the present invention relate to storagemanagement, and more specifically, to a method and system for managing abuffer device in a storage system.

BACKGROUND

With the development of data storage techniques, various data storagedevices now provide users with higher and higher data storage capacity,and also their data access speed has been increased greatly. Besides theincrease of data storage capacity, users also impose greater and greaterdemands on data reliability and response time of storage systems.

A technical solution for building a storage system on the basis ofmulti-level storage media with different access speeds has beendeveloped so far. For example, frequently used data may be loaded from astorage device with a lower access speed to a buffer device with ahigher access speed, and further the buffer device may respond to accessrequests from the outside of the storage system. The technical solutioncan improve the efficiency in data response to some extent. However,since the buffer device itself is subjected to a limited space, onlyimportant data can be loaded thereto. Therefore, it becomes a focus ofattention regarding how to prioritize data and how to allocate morestorage pages to data with higher priorities in the buffer device andrationally schedule data pages in the buffer device.

SUMMARY

Therefore, it is desirable to develop and implement a technical solutionthat is capable of managing a buffer device more flexibly so as toreduce a response time of a storage system and further improve accessperformance of the storage system. It is desired that the technicalsolution can be compatible with existing storage systems and managestorage areas in the storage system more efficiently without extrahardware devices being added to existing storage systems.

In one embodiment of the present invention, there is provided a methodfor managing a buffer device in a storage system, comprising:determining a first priority for a first queue included in the bufferdevice, the first queue comprising at least one data page associatedwith a first storage device in the storage system; in at least oneround, in response to the first priority not satisfying a firstpredetermined condition, updating the first priority according to afirst updating rule, where the first updating rule makes the updatedfirst priority much closer to the first predetermined condition than thefirst priority; and in response to the first priority satisfying thefirst predetermined condition, flushing data in a data page in the firstqueue to the first storage device.

In one embodiment of the present invention, there is provided a systemfor managing a buffer device in a storage system, the system comprising:one or more processors; a memory coupled to at least one processor ofthe one or more processors; computer program instructions stored in thememory which, when executed by the at least one processor, cause adevice to execute a method for managing a storage system. The methodcomprises: determining a first priority for a first queue included inthe buffer device, the first queue comprising at least one data pageassociated with a first storage device in the storage system; in atleast one round, in response to the first priority not satisfying afirst predetermined condition, updating the first priority according toa first updating rule, where the first updating rule makes the updatedfirst priority much closer to the first predetermined condition than thefirst priority; and in response to the first priority satisfying thefirst predetermined condition, flushing data in a data page in the firstqueue to the first storage device.

In one embodiment of the present invention, there is provided a devicefor managing a buffer device in a storage system. The device comprises:a determining module configured to determine a first priority for afirst queue included in the buffer device, the first queue comprising atleast one data page associated with a first storage device in thestorage system; an updating module configured to, in at least one round,in response to the first priority not satisfying a first predeterminedcondition, update the first priority according to a first updating rule,where the first updating rule makes the updated first priority muchcloser to the first predetermined condition than the first priority; anda flushing module configured to, in response to the first prioritysatisfying the first predetermined condition, flush data in a data pagein the first queue to the first storage device.

With the technical solution of the present invention, storage pages maybe allocated in the buffer device for more important data, data pages inthe buffer device may be scheduled rationally, and further the storagesystem may be managed with higher efficiency.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

Through the more detailed description in the accompanying drawings, theabove and other objects, features and advantages of the embodiments ofthe present invention will become more apparent. Several embodiments ofthe present invention are illustrated schematically and are not intendedto limit the present invention. In the drawings:

FIG. 1 schematically illustrates a block diagram of an exemplarycomputer system which is applicable to implement the embodiments of thepresent invention;

FIG. 2 schematically illustrates a block diagram an applicationenvironment where the embodiments of the present invention may beimplemented;

FIG. 3 schematically illustrates a block diagram of a solution formanaging a buffer device in a storage system according to one embodimentof the present invention;

FIG. 4 schematically illustrates a flowchart of a method for managing abuffer device in a storage system according to one embodiment of thepresent invention;

FIG. 5 schematically illustrates a block diagram of a queue for managinga buffer device in a storage system according to one embodiment of thepresent invention;

FIGS. 6A, 6B and 6C schematically illustrate respective block diagramsof different stages for managing a buffer device in a storage systemaccording to one embodiment of the present invention;

FIG. 7 schematically illustrates a block diagram for managing a bufferdevice in a storage system according to one embodiment of the presentinvention;

FIGS. 8A and 8B each schematically illustrate a block diagram of anapplication environment in which the embodiments of the presentinvention; and

FIG. 9 schematically illustrates a block diagram of a device formanaging a buffer device in a storage system according to one embodimentof the present invention.

DETAILED DESCRIPTION

Some preferable embodiments will be described in more detail withreference to the accompanying drawings, in which the preferableembodiments of the present disclosure have been illustrated. However,the present disclosure can be implemented in various manners, and thusshould not be construed to be limited to the embodiments disclosedherein. On the contrary, those embodiments are provided for the thoroughand complete understanding of the present disclosure, and completelyconveying the scope of the present disclosure to those skilled in theart.

FIG. 1 illustrates an exemplary computer system 100 which is applicableto implement the embodiments of the present invention. As illustrated inFIG. 1, the computer system 100 may include: CPU (Central Process Unit)101, RAM (Random Access Memory) 102, ROM (Read Only Memory) 103, SystemBus 104, Hard Drive Controller 105, Keyboard Controller 106, SerialInterface Controller 107, Parallel Interface Controller 108, DisplayController 109, Hard Drive 110, Keyboard 111, Serial PeripheralEquipment 112, Parallel Peripheral Equipment 113 and Display 114. Amongabove devices, CPU 101, RAM 102, ROM 103, Hard Drive Controller 105,Keyboard Controller 106, Serial Interface Controller 107, ParallelInterface Controller 108 and Display Controller 109 are coupled to theSystem Bus 104. Hard Drive 110 is coupled to Hard Drive Controller 105.Keyboard 111 is coupled to Keyboard Controller 106. Serial PeripheralEquipment 112 is coupled to Serial Interface Controller 107. ParallelPeripheral Equipment 113 is coupled to Parallel Interface Controller108. And, Display 114 is coupled to Display Controller 109. It should beunderstood that the structure as illustrated in FIG. 1 is only for theexemplary purpose rather than any limitation to the present invention.In some cases, some devices may be added to or removed from the computersystem 100 based on specific situations.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or oneembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

FIG. 2 shows a schematic view 200 of an application environment in whichthe embodiments of the present invention may be implemented. As shown inFIG. 2, a storage system may comprise, for example, three layers ofstorage structures: a storage device 210 is an underlying storagedevice, e.g., may comprise a solid state disk (SSD) 212 and/or a disk214; the storage device 210 has a lower data access speed, whereas sucha type of storage media has a large storage capacity and is cheap, andthus may provide a large capacity of data storage for a data system. Abuffer device 220 (e.g., solid state cache) has a quite high data accessspeed; this type of storage media may be used as a buffer device, andrecently accessed data may be loaded from the storage device 210 to thebuffer device so as to provide higher response efficiency for futuredata access. A dynamic random access memory (DRAM) cache 230 has a muchfaster data access speed, to which the most recently accessed data orimportant data may be loaded, so that data access requests may be servedwith higher efficiency.

When the storage system receives a data access request 240, a search maybe sequentially conducted in the DRAM cache 230 and the buffer device220, and if the search hits, the received access request 240 may beserved directly on the basis of data in these fast devices; if thesearch misses, then data has to be fetched from the slow storage device210. In this way, the three-layer storage structures 210, 220 and 230may work in coordination so as to provide a rapid data response.

According to existing technical solutions, the buffer device 220 is atthe upper level of the storage device 210, and data in different typesof the storage device 210 (e.g., the SSD 212 and the disk 214) may allbe loaded to the buffer device 220. However, different storage devicesmay vary in access speed, state and importance of data stored therein.Therefore, it is desirable to develop a technical solution capable ofprioritizing storage devices and further allocating and scheduling apage space in a buffer device on the basis of the priorities.

To this end, one embodiment of the present invention proposes a methodfor managing a buffer device in a storage system. The method comprises:determining a first priority for a first queue included in the bufferdevice, the first queue comprising at least one data page associatedwith a first storage device in the storage system; in at least oneround, in response to the first priority not satisfying a firstpredetermined condition, updating the first priority according to afirst updating rule, the first updating rule making the updated firstpriority much closer to the first predetermined condition than the firstpriority; and in response to the first priority satisfying the firstpredetermined condition, flushing data in a data page in the first queueto the first storage device.

Specifically, FIG. 3 schematically shows a block diagram 300 of asolution for managing a buffer device in a storage system according toone embodiment of the present invention. As shown in FIG. 3, a queue 310comprises at least one data page 312, . . . , 314 associated with astorage device in the storage system, for example, the at least one datapage 312, . . . , 314 being loaded from the disk 214 as shown in FIG. 2to the buffer device 220. Here, a priority 320 may be determined for thequeue 310 so as to represent whether a page in the queue should beflushed to a corresponding storage device in each round of flushoperation.

In one embodiment of the present invention, the storage device shownhere may be a physical storage device of a physical disk, or may be avirtual storage device. For example, the storage device may berepresented by an identifier of a physical device, or may further berepresented by a logical address (e.g., logical unit number (LUN)).Although only one queue 310 is illustrated in FIG. 3, more queues may beprovided. For example, among storage devices of a redundant array ofindependent disks (RAID), each storage device may be provided with onequeue. Or each LUN may be provided with one queue.

On the basis of the structure shown in FIG. 3, in each round ofoperation, whether flushing operation is performed to one or more pagesin the queue may be determined by judging whether the priority satisfiesa predetermined condition. Further a value of the priority of the queuemay be modified, and in the next round whether a flush is performed ornot may be determined on the basis of the modified priority. Withreference to FIG. 4, a detailed description is presented below toconcrete steps of the method of the present invention.

FIG. 4 schematically shows a flowchart 400 of a method for managing abuffer device in a storage system according to one embodiment of thepresent invention. Specifically, in step 410 a first priority isdetermined for a first queue included in the buffer device, where thefirst queue comprises at least one data page associated with a firststorage device in the storage system. In this step, the queue and thepriority may be stored using the structure as shown in FIG. 3. Forexample, a priority field according to the present invention may bestored in association with a queue in the prior technical solution, soas to set a priority for a queue. In this step, the priority may bestored using various formats. For example, the priority may berepresented as an integer, a real number or other format.

Note in this step the at least one data page in the first queue mayinvolve multiple circumstances. For example, the data page may be pagewhich, in response to receiving a read request with respect to the firststorage device, is loaded from the first storage device to the bufferdevice. For another example, the data page may further be a page which,in response to receiving a write request with respect to the firststorage device, is temporarily written to the buffer device and willfinally be flushed to the first storage device.

In step 420, in at least one round, in response to the first prioritynot satisfying a first predetermined condition, the first priority isupdated according to a first updating rule, the first updating rulemaking the updated first priority much closer to the first predeterminedcondition than the first priority. Concrete content of the predeterminedcondition may be customized. For example, when the priority isrepresented as an integer or a real number, the predetermined conditionmay be set to a condition such as “priority=0” or “priority□0.” Concretecontent of the updating rule may also be customized. For example, whenthe priority is represented as an integer or a real number, the updatingrule may be set as: using a current priority minus/plus one step lengthas the updated priority. Note the updating rule here should try to makethe updated priority much closer to the predetermined condition than acurrent priority.

In step 430, in response to the first priority satisfying the firstpredetermined condition, data in a data page in the first queue isflushed to the first storage device.

For the sake of description, an integer will be used as a specificexample of the priority. For example, a priority “2” may be assigned tothe queue, the predetermined condition may be “priority=0,” and theupdating rule may be “updated priority=current priority −1”. At thispoint, in the first round a priority 3 does not satisfy thepredetermined condition, so the priority should be updated as 3−1=2. Apage in the queue will not be flushed to a storage device. In the secondround, a priority 2 also does not satisfy the predetermined condition,so the priority should be updated as 2−1=1. At this point, the page inthe queue will not be flushed to the storage device. In the third round,the priority is updated as 1−1=0 and thus satisfies the predeterminedcondition “priority=0” at this point. So the page (e.g., one or morepages) in the queue may be flushed to the storage device.

The priority of the queue may be determined on the basis of variousfactors. Specifically, in one embodiment of the present invention, thefirst priority may be set on the basis of at least one of: a responsetime associated with the first storage device, a usage rate of thebuffer device by the first storage device, and an access frequency ofaccess requests with respect to the first storage device.

In this embodiment, the priority of a storage device might besusceptible to various factors. For example, if the storage device has aquite long response time, this means its access speed is rather slow, atwhich point a page associated with the storage device should be saved inthe buffer device with a faster access speed for as long as possible(for example, data associated with a write request and to be written tothe storage device, or data associated with a read request and stored inthe storage device).

For another example, if data associated with a storage device has takenup most storage spaces in the buffer device (e.g., a high usage rate),this means only less storage spaces in the buffer device can serve otherstorage devices, at which point the usage rate associated with thestorage device can be decreased properly (for example, data in one ormore pages in the queue will be flushed to the storage device).

For another example, if the frequency (e.g., represented asinputs/outputs per second (IOPS)) of received access requests withrespect to a storage device is quite high, this means data in thestorage device is more likely to be accessed, so in the buffer devicemore spaces are supposed to be allocated for the storage device.

In one embodiment of the present invention, the setting the firstpriority comprises at least one of: in response to an increment of theresponse time being larger than or equal to a first predeterminedthreshold, increasing the first priority; in response to an increment ofthe usage rate being larger than or equal to a second predeterminedthreshold, decreasing the first priority; and in response to anincrement of the access frequency being larger than or equal to a thirdpredetermined threshold, increasing the first priority. Specifically, avalue of the priority may be calculated from Formula 1 as below:

$\begin{matrix}{S = \frac{\alpha \cdot r \cdot {\gamma.f}}{\beta \cdot u}} & {{Formula}\mspace{14mu} 1}\end{matrix}$

Wherein S represents a value of the first priority, r represents aresponse time (e.g., denoted in milliseconds) associated with the firststorage device, u represents the usage rate (e.g., denoted inpercentage) of the first storage device in utilization of the bufferdevice, f represents an access frequency of access requests (e.g.,denoted in IOPS) with respect to the first storage device, and α, β andγ each represent a customized weight.

In one embodiment of the present invention, a value of the priority mayfurther be calculated on the basis of other formula. For example, thecalculation may be based on Formula 2 (parameters in Formula 2 aredefined in the same way as parameters in Formula 1). Or those skilled inthe art may further customize other formula to determine the priority ofthe queue.

S=α·r+γ·f−β·u  Formula 2

In this embodiment, the calculated priority may be normalized within apredetermined range, for example, the calculated value may be mapped toa range [0-10]. The updating rule may be defined on the basis of a rangeof priorities. For example, the size of a step length in the updatingrule may be determined on the basis of a value range of priorities.Regarding the range [0-10], a decreasing step length in the updatingrule may be set to 1. At this point, if the priority of a queue is 10,then the queue will go through flushing operation in the 10th round. Ifthe decreasing step length is 2, then the queue will go through flushingoperation in the 5th round.

In one embodiment of the present invention, the flushing data in onedata page of the at last one data page to the first storage devicecomprises: selecting a target page from the first queue according to theleast recently used (LRU) standard; and flushing data in the target pageto the first storage device.

In this embodiment, a target page to be flushed may be selected on thebasis of the LRU standard. Alternatively, queues may be ranked accordingto the LRU standard. FIG. 5 schematically shows a block diagram 500 formanaging a queue in a buffer device in a storage system. As shown inFIG. 5, a queue 510 comprises pages 512, . . . , 514, and these pagesmay be ranked in hot-to-cold order. In this way, when it is determinedon the basis of priorities that data in the queue needs to be flushed,the coldest page 514 may be selected from the end of the queue 510 asthe target page.

Concrete steps of operation performed to a queue associated with astorage device have been described with reference to FIGS. 3 to 5. Notein the embodiments of the present invention, the buffer device mayfurther comprise multiple queues, and each of the multiple queues maycomprise pages associated with a corresponding storage device. Eachqueue may have its own priority, and the method described with referenceto FIGS. 3 to 5 may be performed to each queue.

In one embodiment of the present invention, there is further comprised:determining a second priority for a second queue included in the bufferdevice, where the second queue comprises at least one data pageassociated with a second storage device in the storage system; in the atleast one round, in response to the second priority not satisfying asecond predetermined condition, updating the second priority accordingto a second updating rule, where the second updating rule makes theupdated second priority much closer to the second predeterminedcondition than the second priority; and in response to the secondpriority satisfying the second predetermined condition, flushing data ina data page in the second queue to the second storage device.

In this embodiment, the second queue is a queue different than the firstqueue, and the priority, predetermined condition and updating rule forthe second queue are either the same as or different than those for thefirst queue. For example, suppose two storage devices in the storagesystem have completely same configurations and running states, at thispoint respective priorities, predetermined conditions and updating rulesfor the two storage devices may be identical. For another example, ifconfigurations and running states of two storage devices differ, thendifferent priorities, predetermined conditions and updating rules may beset for the two storage devices.

With reference to FIGS. 6A to 6C, description is presented below todetails of this embodiment. Specifically, FIGS. 6A to 6C schematicallyshow block diagrams 600A, 600B and 600C of different rounds for managinga buffer device in a storage system according to one embodiment of thepresent invention. In this embodiment, an initial priority of the firstqueue is 3, and an initial priority of the second queue is 1. Supposepredetermined conditions for the two queues are identical, i.e.,“priority=0,” and updating rules for both queues are updatedpriority=current priority−1.

As shown in FIG. 6A, the first queue comprises pages 612, . . . , 614,616 and 618, the second queue comprises pages 622, . . . , 624, 626 and628. With the method described above, in the first round, the priorityof the first queue is updated as 3−1=2, and the priority of the secondqueue is updated as 1−1=0 (satisfying the predetermined condition). Atthis point, the page 628 at the end of the second queue will be flushedto the second storage device associated with the second queue.

FIG. 6B shows details of the second round, at which point 1 will beassigned to the priority of the second queue as the priority hassatisfied the predetermined condition. In the second round, the priorityof the first queue is updated as 2−1=1, and the priority of the secondqueue is updated as 1−1=0 (satisfying the predetermined condition). Atthis point, the page 626 at the end of the second queue will be flushedto the second storage device associated with the second queue.

FIG. 6C shows details of the third round, at which point 1 will beassigned to the priority of the second queue. In the third round, thepriority of the first queue is updated as 1−1=0 (satisfying thepredetermined condition), at which point the page 618 at the end of thefirst queue will be flushed to the first storage device associated withthe first queue. The priority of the second queue is updated as 1−1=0(satisfying the predetermined condition), at which point the page 624 atthe end of the second queue will be flushed to the second storage deviceassociated with the second queue.

In one embodiment of the present invention, the first storage device isprovided with a first level, the second storage device is provided witha second level, and the first level is higher than the second level. Inthis embodiment, multiple storage devices may have different priorities.For example, regarding the example shown in FIGS. 6A to 6C, since thelevel of the first storage device is higher than that of the secondstorage device, the first queue is set to a higher initial priority 3,and the second queue is set to a lower initial priority 1.

In the embodiment shown in FIGS. 6A to 6C, as priorities of the firstqueue and the second queue differ, the frequencies at which data in thetwo queues is flushed to respective storage devices also vary. Flushingoperation is performed to the first queue only once in three rounds,while flushing operation is performed to the second queue three times inthree rounds. In this embodiment, since the first queue has a higherinitial priority, the first queue takes precedence over the second queuein utilizing storage resources in the storage device. In this way,corresponding page scheduling policies may be set for different storagedevices in light of different priorities.

In one embodiment of the present invention, the determining a secondpriority for a second queue included in the buffer device comprises:setting the second priority such that the rate at which the secondpriority is updated to satisfy the second predetermined conditionaccording to the second updating rule is faster than the rate at whichthe first priority is updated to satisfy the first predeterminedcondition according to the first updating rule.

A value of the second priority may be set using various approaches. Forexample, where the first and second updating rules are identical and thefirst and second predetermined conditions are identical, a value of thesecond priority may be set lower than that of the first priority. Asshown in FIG. 6A, the first priority is set to 3, and the secondpriority is set to 1. In this way, the second priority will satisfy thesecond predetermined condition in the first round.

For another example, the second priority may further be set to the samevalue “3” as the first priority, but the second updating rule may beprovided with a larger decreasing step length, e.g., “3.” In this way,the second priority will satisfy the second predetermined condition inthe first round.

For another example, both the second priority and the first priority maybe set to “3,” and both the second updating rule and the first updatingrule may be set to “minus 1,” but the second predetermined condition maybe set as “priority=2.” In this way, the second priority will satisfythe second predetermined condition in the first round. Note specificexamples of how to set the priority, predetermined condition andupdating rule have been provided for the illustration purpose only.According to requirements of concrete application environments, othermethods may further be used to perform functions of the technicalsolution described herein.

While the example in which two queues are involved has been described indetail above, in other embodiments the buffer device may furthercomprise more queues. FIG. 7 schematically shows a block diagram 700 formanaging a buffer device in a storage system according to one embodimentof the present invention. As shown in FIG. 7, suppose a first, second,third queues are associated with a first, second, third storage devicesrespectively, and the levels of the three queues meet such a relation asthe first level>the second level=the third level. At this point, ahigher priority 3 may be assigned to the first queue, and a lowerpriority 1 may be assigned to each of the second and third queues.

With the method described above, suppose in each round the three queuesare processed in an order from bottom to top of FIG. 7, then in thefirst round, both priorities of the third and second queues are 1, so apage 720 (denoted as circled 1 in FIG. 7) at the end of the third queueis first flushed, and then a page 628 at the end of the second queue isflushed. Since the priority of the first queue is 3−1=2, so pages in thefirst queue will not be flushed. In the second round, a page 718 in thethird queue and a page 626 in the second queue are flushed. In the thirdround, a page 716 in the third queue, a page 624 in the second queue anda page 618 in the first queue are flushed. In this embodiment, pages areflushed in an order shown in circles in FIG. 7: the page 720, the page628, the page 718, the page 626, the page 716, the page 624, and thepage 618.

In one embodiment of the present invention, the storage system is aRedundant Array of Independent Disks, the first storage device is afailed storage device in the Redundant Array of Independent Disks, andthe second storage device is a normal storage device in the RedundantArray of Independent Disks. In this embodiment, since the failed storagedevice in the RAID storage system is being rebuilt, to preventconventional data access requests from interfering with rebuildingoperation, more spaces in the buffer device may be allocated for thefailed storage device to buffer data. Therefore, a higher priority maybe set for the failed storage device, and a lower priority may be setfor other normal storage device.

For example, in FIG. 7 the first queue may be a queue associated withthe failed storage device, while the second and third queues may bequeues associated with normal storage devices. As shown in FIG. 7,during flushing, pages in the second and third queues are flushed tocorresponding normal storage devices in each round, while a page in thefirst queue is not flushed until the third round. With the technicalsolution of the present invention, more spaces may be reserved in thebuffer device for the failed storage device.

FIG. 8A schematically illustrates a schematic view 800A of a structureof RAID according to one technical solution. In this figure, workingprinciples of RAID are illustrated by taking RAID-5, which consists offive independent storage devices (810A, 812A, 814A, 816A and 818A), asan example. It should be noted although five storage devices areillustrated in FIG. 8A, in other embodiments more or less storagedevices may be provided according to different versions of RAID.Moreover, although FIG. 8A shows stripes 820A, 822A and 824A, in otherexamples the RAID system may further comprise a different number ofstripes.

In RAID, a stripe crosses multiple physical storage devices (forexample, the stripe 820A crosses the storage devices 810A, 812A, 814A,816A and 818A). The stripe may simply be construed as a storage areaamong multiple storage devices which satisfies a given address range.Data stored in the stripe 820 comprises multiple parts: a data block D1₁ stored in the storage device 810A, a data block D1 ₂ stored in storagedevice the 812A, a data block D1 ₃ stored in the storage device 814A, adata block D1 ₄ stored in the storage device 816A, and a data block P1stored in the storage device 818A. In this example, the data blocks D1₁, D1 ₂, D1 ₃ and D1 ₄ are stored data, and the data block P1 is aparity of the stored data.

The mode of storing data in other stripes is similar to that in thestripe 820A, and the difference is that a checksum about other datablock may be stored in other storage device than the storage device818A. In this way, when one of the multiple storage devices 810A, 812A,814A, 816A and 818A fails, data in the failing device may be recoveredfrom other normal storage devices.

FIG. 8B schematically shows a schematic view 800B of rebuilding processof RAID according to one technical solution. As shown in FIG. 8B, whenone storage device (e.g., the storage device 818A shown in shadow)fails, data may be recovered from the remaining storage devices 810A,812A, 814A and 816A that operate normally. At this point, a new backupstorage device 818B may be added to RAID to replace the storage device818A. In this way, recovered data may be written to 818B, and a systemrebuilding may be effected.

The embodiments of the present invention may be applied to the RAIDstorage system shown in FIGS. 8A and 8B. Specifically, the failedstorage device 818A shown in FIG. 8B may be the first storage devicementioned in the present invention, and the further normal storagedevices 810A, 812A, 814A, and 816A may be the multiple second storagedevices. Note in this embodiment since the first queue is associatedwith the failed storage device 818A to which data cannot be directlywritten during flushing, according to working principles of the RAIDstorage system, data is written to the further normal storage devices810A, 812A, 814A and 816A in the RAID storage system.

In one embodiment of the present invention, a data access speed of thefirst storage device is lower than a data access speed of the secondstorage device. In this embodiment, more buffer spaces may be allocatedfor a storage device with a lower data access speed. For example, theaccess speed of a storage device of hard disk type might be slower thanthat of a storage device of solid state storage medium type, so morebuffer spaces may be provided in the buffer device for the hard diskstorage device.

In one embodiment of the present invention, different services may beprovided to different users according to levels of the users in thestorage system. For example, more buffer spaces may be provided for animportant user, while less buffer spaces may be provided for an ordinaryuser.

In one embodiment of the present invention, the method is executed inresponse to any of: insufficiency of available spaces in the bufferdevice, and external invocation. The method of the present invention maybe executed in different stages of the running of the storage system.For example, the method may be executed where available spaces in thebuffer device are insufficient, may be periodically executed, or may beexecuted in response to invocation.

FIG. 9 schematically shows a block diagram 900 of a device for managinga buffer device in a storage system according to one embodiment of thepresent invention. Specifically, there is provided a device for managinga buffer device in a storage system, comprising: a determining module910 configured to determine a first priority for a first queue includedin the buffer device, the first queue comprising at least one data pageassociated with a first storage device in the storage system; anupdating module 920 configured to, in at least one round, in response tothe first priority not satisfying a first predetermined condition,update the first priority according to a first updating rule, the firstupdating rule making the updated first priority much closer to the firstpredetermined condition than the first priority; and a flushing module930 configured to, in response to the first priority satisfying thefirst predetermined condition, flush data in a data page in the firstqueue to the first storage device.

In one embodiment of the present invention, the determining module 910is further configured to set the first priority on the basis of at leastone of: a response time associated with the first storage device, ausage rate of the buffer device by the first storage device, and anaccess frequency of access requests with respect to the first storagedevice.

In one embodiment of the present invention, the determining module 910is further configured to: in response to an increment of the responsetime being larger than or equal to a first predetermined threshold,increase the first priority; in response to an increment of the usagerate being larger than or equal to a second predetermined threshold,decrease the first priority; and in response to an increment of theaccess frequency being larger than or equal to a third predeterminedthreshold, increase the first priority.

In one embodiment of the present invention, the flushing module 930 isfurther configured to select a target page from the first queueaccording to the least recently used standard; and flush data in thetarget page to the first storage device.

In one embodiment of the present invention, the determining module isfurther configured to determine a second priority for a second queueincluded in the buffer device, the second queue comprising at least onedata page associated with a second storage device in the storage system;the updating module is further configured to, in the at least one round,in response to the second priority not satisfying a second predeterminedcondition, update the second priority according to a second updatingrule, the second updating rule making the updated second priority muchcloser to the second predetermined condition than the second priority;and the flushing module is further configured to, in response to thesecond priority satisfying the second predetermined condition, flushdata in a data page in the second queue to the second storage device.

In one embodiment of the present invention, the first storage device isprovided with a first level, the second storage device is provided witha second level, and the first level is higher than the second level.

In one embodiment of the present invention, the determining module 910is further configured to: set the second priority such that the rate atwhich the second priority is updated to satisfy the second predeterminedcondition according to the second updating rule is faster than the rateat which the first priority is updated to satisfy the firstpredetermined condition according to the first updating rule.

In one embodiment of the present invention, the storage system is aRedundant Array of Independent Disks, the first storage device is afailed storage device in the Redundant Array of Independent Disks, andthe second storage device is a normal storage device in the RedundantArray of Independent Disks.

In one embodiment of the present invention, a data access speed of thefirst storage device is lower than a data access speed of the secondstorage device.

In one embodiment of the present invention, the determining module 910,the updating module 920 and the flushing module 930 operate in responseto any of: insufficiency of available spaces in the buffer device, andinvocation.

In one embodiment of the present invention, there is provided a systemfor managing a buffer device in a storage system, the system comprising:one or more processors; a memory coupled to at least one processor ofthe one or more processors; computer program instructions stored in thememory which, when executed by the at least one processor, cause adevice to execute a method for managing a storage system. The methodcomprising: determining a first priority for a first queue included inthe buffer device, the first queue comprising at least one data pageassociated with a first storage device in the storage system; in atleast one round, in response to the first priority not satisfying afirst predetermined condition, updating the first priority according toa first updating rule, the first updating rule making the updated firstpriority much closer to the first predetermined condition than the firstpriority; and in response to the first priority satisfying the firstpredetermined condition, flushing data in a data page in the first queueto the first storage device.

In one embodiment of the present invention, the determining a firstpriority for a first queue included in the buffer device comprises:setting the first priority on the basis of at least one of: a responsetime associated with the first storage device, a usage rate of thebuffer device by the first storage device, and an access frequency ofaccess requests with respect to the first storage device.

In one embodiment of the present invention, the setting the firstpriority comprises at least one of: in response to an increment of theresponse time being larger than or equal to a first predeterminedthreshold, increasing the first priority; in response to an increment ofthe usage rate being larger than or equal to a second predeterminedthreshold, decreasing the first priority; and in response to anincrement of the access frequency being larger than or equal to a thirdpredetermined threshold, increasing the first priority.

In one embodiment of the present invention, the flushing data in onedata page of the at last one data page to the first storage devicecomprises: selecting a target page from the first queue according to theleast recently used (LRU) standard; and flushing data in the target pageto the first storage device.

In one embodiment of the present invention, there is further comprised:determining a second priority for a second queue included in the bufferdevice, the second queue comprising at least one data page associatedwith a second storage device in the storage system; in the at least oneround, in response to the second priority not satisfying a secondpredetermined condition, updating the second priority according to asecond updating rule, the second updating rule making the updated secondpriority much closer to the second predetermined condition than thesecond priority; and in response to the second priority satisfying thesecond predetermined condition, flushing data in a data page in thesecond queue to the second storage device.

In one embodiment of the present invention, the first storage device isprovided with a first level, the second storage device is provided witha second level, and the first level is higher than the second level.

In one embodiment of the present invention, the determining a secondpriority for a second queue included in the buffer device comprises:setting the second priority such that the rate at which the secondpriority is updated to satisfy the second predetermined conditionaccording to the second updating rule is faster than the rate at whichthe first priority is updated to satisfy the first predeterminedcondition according to the first updating rule.

In one embodiment of the present invention, the storage system is aRedundant Array of Independent Disks, the first storage device is afailed storage device in the Redundant Array of Independent Disks, andthe second storage device is a normal storage device in the RedundantArray of Independent Disks.

In one embodiment of the present invention, a data access speed of thefirst storage device is lower than a data access speed of the secondstorage device.

In one embodiment of the present invention, the method is executed inresponse to any of: insufficiency of available spaces in the bufferdevice, and invocation.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks illustrated in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

1. A method for managing a buffer device in a storage system,comprising: determining a first priority for a first queue included inthe buffer device, the first queue comprising at least one data pageassociated with a first storage device in the storage system; in atleast one round, in response to the first priority not satisfying afirst predetermined condition, updating the first priority according toa first updating rule, the first updating rule making the updated firstpriority much closer to the first predetermined condition than the firstpriority; and in response to the first priority satisfying the firstpredetermined condition, flushing data in a data page in the first queueto the first storage device.
 2. The method according to claim 1, whereinthe determining a first priority for a first queue included in thebuffer device comprises: setting the first priority on the basis of atleast one of: a response time associated with the first storage device,a usage rate of the buffer device by the first storage device, and anaccess frequency of access requests with respect to the first storagedevice.
 3. The method according to claim 2, wherein the setting thefirst priority comprises at least one of: in response to an increment ofthe response time being larger than or equal to a first predeterminedthreshold, increasing the first priority; in response to an increment ofthe usage rate being larger than or equal to a second predeterminedthreshold, decreasing the first priority; and in response to anincrement of the access frequency being larger than or equal to a thirdpredetermined threshold, increasing the first priority.
 4. The methodaccording to claim 1, wherein the flushing data in one data page of theat last one data page to the first storage device comprises: selecting atarget page from the first queue according to a least recently usedstandard; and flushing data in the target page to the first storagedevice.
 5. The method according to 1, further comprising: determining asecond priority for a second queue included in the buffer device, thesecond queue comprising at least one data page associated with a secondstorage device in the storage system; in the at least one round, inresponse to the second priority not satisfying a second predeterminedcondition, updating the second priority according to a second updatingrule, the second updating rule making the updated second priority muchcloser to the second predetermined condition than the second priority;and in response to the second priority satisfying the secondpredetermined condition, flushing data in a data page in the secondqueue to the second storage device.
 6. The method according to claim 5,wherein the first storage device is provided with a first level, thesecond storage device is provided with a second level, and the firstlevel is higher than the second level.
 7. The method according to claim6, wherein the determining a second priority for a second queue includedin the buffer device comprises: setting the second priority such thatthe rate at which the second priority is updated to satisfy the secondpredetermined condition according to the second updating rule is fasterthan the rate at which the first priority is updated to satisfy thefirst predetermined condition according to the first updating rule. 8.The method according to claim 6, wherein the storage system is aRedundant Array of Independent Disks, the first storage device is afailed storage device in the Redundant Array of Independent Disks, andthe second storage device is a normal storage device in the RedundantArray of Independent Disks.
 9. The method according to claim 6, whereina data access speed of the first storage device is lower than a dataaccess speed of the second storage device.
 10. The method according toclaim 1, wherein the method is executed in response to any of:insufficiency of available spaces in the buffer device, and aninvocation.
 11. A system for managing a buffer device in a storagesystem, comprising: one or more processors; a memory coupled to at leastone processor of the one or more processors; computer programinstructions stored in the memory which, when executed by the at leastone processor, cause the system to execute a method for managing astorage system, the method comprising: determining a first priority fora first queue included in the buffer device, the first queue comprisingat least one data page associated with a first storage device in thestorage system; in at least one round, in response to the first prioritynot satisfying a first predetermined condition, updating the firstpriority according to a first updating rule, the first updating rulemaking the updated first priority much closer to the first predeterminedcondition than the first priority; and in response to the first prioritysatisfying the first predetermined condition, flushing data in a datapage in the first queue to the first storage device.
 12. The systemaccording to claim 11, wherein the determining a first priority for afirst queue included in the buffer device comprises: setting the firstpriority on the basis of at least one of: a response time associatedwith the first storage device, a usage rate of the buffer device by thefirst storage device, and an access frequency of access requests withrespect to the first storage device.
 13. The system according to claim12, wherein the setting the first priority comprises at least one of: inresponse to an increment of the response time being larger than or equalto a first predetermined threshold, increasing the first priority; inresponse to an increment of the usage rate being larger than or equal toa second predetermined threshold, decreasing the first priority; and inresponse to an increment of the access frequency being larger than orequal to a third predetermined threshold, increasing the first priority.14. The system according to claim 11, wherein the flushing data in onedata page of the at last one data page to the first storage devicecomprises: selecting a target page from the first queue according to aleast recently used standard; and flushing data in the target page tothe first storage device.
 15. The system according to claim 11, themethod further comprising: determining a second priority for a secondqueue included in the buffer device, the second queue comprising atleast one data page associated with a second storage device in thestorage system; in the at least one round, in response to the secondpriority not satisfying a second predetermined condition, updating thesecond priority according to a second updating rule, the second updatingrule making the updated second priority much closer to the secondpredetermined condition than the second priority; and in response to thesecond priority satisfying the second predetermined condition, flushingdata in a data page in the second queue to the second storage device.16. The system according to claim 5, wherein the first storage device isprovided with a first level, the second storage device is provided witha second level, and the first level is higher than the second level. 17.The system according to claim 16, wherein the determining a secondpriority for a second queue included in the buffer device comprises:setting the second priority such that the rate at which the secondpriority is updated to satisfy the second predetermined conditionaccording to the second updating rule is faster than the rate at whichthe first priority is updated to satisfy the first predeterminedcondition according to the first updating rule.
 18. The system accordingto claim 16, wherein the storage system is a Redundant Array ofIndependent Disks, the first storage device is a failed storage devicein the Redundant Array of Independent Disks, and the second storagedevice is a normal storage device in the Redundant Array of IndependentDisks.
 19. The system according to claim 16, wherein a data access speedof the first storage device is lower than a data access speed of thesecond storage device.
 20. The system according to claim 11, wherein themethod is executed in response to any of: insufficiency of availablespaces in the buffer device, and an invocation.